package com.sphd.emanu.adapter;

import android.graphics.Color;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseItemDraggableAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sphd.emanu.R;
import com.sphd.emanu.fragment.work.WorkFragment;
import com.sphd.emanu.pojo.WorkEntity;
import com.wzutils.L;


import java.util.List;

/**
 * @Author Hu
 * @Time 2017/4/7 --11:33.
 * @Email 87683202@qq.com
 */
public class WorkFragmentAdapter extends BaseItemDraggableAdapter<WorkEntity, BaseViewHolder> {

    public WorkFragmentAdapter(int layoutResId, List<WorkEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WorkEntity item) {

        helper
                .setText(R.id.work_type, item.getSrcName())
                .setImageResource(R.id.work_img, item.getSrcId());
            ImageView imageView = helper.getView(R.id.work_img);
        if (!item.isCanLook()) {
            imageView.setColorFilter(Color.GRAY);
        }

    }

}
